
<%@ page import="org.ikastola.Receipt" %>
<!DOCTYPE html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'receipt.label', default: 'Receipt')}" />
		<title><g:message code="default.list.label" args="[entityName]" /></title>
	</head>
	<body>
		<a href="#list-receipt" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div class="nav" role="navigation">
			<ul>
				<li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
<%--				<li><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></li>--%>
				<li><a class="list"> <g:message code="default.search.label"/>: </a></li>
				<g:form name="search" url="[action:'search',controller:'receipt']">
					<li><input type="text" name="query" /> <input type="submit"/></li>
				</g:form>
			</ul>
		</div>
		<div id="list-receipt" class="content scaffold-list" role="main">
			<h1><g:message code="default.list.label" args="[entityName]" /></h1>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<table>
				<thead>
					<tr>
						<g:sortableColumn property="student" title="${message(code: 'receipt.student.label', default: 'Students')}" />
						
						<g:sortableColumn property="total" title="${message(code: 'receipt.total.label', default: 'Total')}" />
					
						<g:sortableColumn property="due" title="${message(code: 'receipt.due.label', default: 'Due')}" />
					
						<g:sortableColumn property="creationdate" title="${message(code: 'receipt.creationdate.label', default: 'Creationdate')}" />
					
					</tr>
				</thead>
				<tbody>
				<g:each in="${receiptInstanceList}" status="i" var="receiptInstance">
					<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
					
						<td><g:link action="show" id="${receiptInstance.id}">
							${fieldValue(bean: receiptInstance?.student, field: "name")} ${fieldValue(bean: receiptInstance?.student, field: "lastname")}
							</g:link>
						</td>
						
						<td>${fieldValue(bean: receiptInstance, field: "total")}</td>
						
						<td>${fieldValue(bean: receiptInstance, field: "due")}</td>
					
						<td><g:formatDate date="${receiptInstance.creationdate}" formatName="receipt.paymentdate.format.day" /></td>
					
					</tr>
				</g:each>
				</tbody>
			</table>
			
			<%-- <g:jasperReport jasper="report" controller="data" action="pdf" format="pdf" name="TEST" description=" " delimiter=" "/> --%>
			
			<div class="pagination">
				<g:paginate total="${receiptInstanceTotal}" />
			</div>
		</div>
	</body>
</html>
